home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q30447 < prev    next >
Text File  |  1988-07-29  |  1KB  |  46 lines

  1. Q30447 Code Generation Incorrect when Compiled with Default/Ot Option
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Problem:
  7.    The code generated for the following example is incorrect when
  8. compiled with the default options or with the /Ot option.
  9.    The code generated for the second assignment statement assumes that
  10. the variable PBuf has not changed across the CALL to the function
  11. bar(). Specifically, the second assignment is performed as PBuf->OffV
  12. = PBuf->OffV.
  13.    The following is a sample code:
  14.  
  15. struct Ptrace_B {
  16.         unsigned        Value;
  17.         unsigned        OffV;
  18.         unsigned        SegV;
  19. };
  20. struct FP_Regs_B {
  21.         unsigned                DataOffset;
  22.         unsigned                DataSelector;
  23. };
  24. typedef unsigned short WORD;
  25. typedef unsigned long WORD;
  26. struct Ptrace_B *PBuf;
  27. foo()
  28. {
  29.         struct FP_Regs_B FP_Regs;
  30.         PBuf->OffV = ((WORD)(char far *) &FP_Regs);
  31.         bar();
  32.         PBuf->OffV = ((WORD)(char far *) &FP_Regs);
  33. }
  34.  
  35. Response:
  36.    Microsoft has confirmed this to be a problem in the C Compiler
  37. Version 5.10. We are researching this problem and will post new
  38. information as it becomes available.
  39.    You can work around this problem by not optimizing for time (i.e.,
  40. do not use /Ot).
  41.  
  42.  
  43.  
  44. Keywords:  buglist5.10
  45. Updated  88/07/29 14:28
  46.